package com.kaifamiao.N0812;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Node2 {

    public static <object> void main(String[] args) {

        List list = new ArrayList();

        //ArrayList list1 = new ArrayList();

        list.add("a");
        list.add("b");
        list.add("c");
        list.add("d");
        list.add("e");
        list.add("f");

        //for-each-loop
        for(Object object : list){
            System.out.println(object);
        }

        System.err.println("===================");

        //迭代器
        Iterator iter = list.iterator();

        while(iter.hasNext()){
            System.out.println(iter.next());
        }

    }

}











